//
//  DatPpickerViewController.m
//  WE
//
//  Created by 要帅气的生活 on 15/11/24.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "DatPpickerViewController.h"
#import "UWDatePickerView.h"
@interface DatPpickerViewController ()<UWDatePickerViewDelegate>
@property (nonatomic,strong) UWDatePickerView *pickerView;
@end

@implementation DatPpickerViewController

- (void)setupDateView:(DateType)type {
    
    _pickerView = [UWDatePickerView instanceDatePickerView];
    _pickerView.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
    [_pickerView setBackgroundColor:[UIColor greenColor]];
    _pickerView.delegate = self;
    _pickerView.type = type;
    [self.view addSubview:_pickerView];
    
}
- (void)getSelectDate:(NSString *)date type:(DateType)type {
    
    NSLog(@"时间 : %@",date);
    switch (type) {
        case DateTypeOfStart:
            // TODO 日期确定选择
            self.suml(date);
            
            [self dismissViewControllerAnimated:YES completion:^{
                
            }];
           // break;
            
        case DateTypeOfEnd:
            // TODO 日期取消选择
            [self dismissViewControllerAnimated:YES completion:^{
                
            }];
            //break;
        default:
            break;
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupDateView:DateTypeOfStart];
}
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
